package com.cenntro.common.mq;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Conditional;
import org.springframework.stereotype.Component;

import com.cenntro.common.mq.producer.MQProducerCondition;

import lombok.Data;
@Conditional(MQProducerCondition.class)
@Component
@Data
public class config {

	
	/**
	 * 发送同一类消息的设置为同一个group，保证唯一,默认不需要设置，rocketmq会使用ip@pid(pid代表jvm名字)作为唯一标示
	 */
	@Value("${rocketmq.producer.groupname}")
	private String producerGroupName;
	@Value("${rocketmq.producer.namesrvAddr}")
	private String namesrvAddr;
	/**
	 * 消息最大大小，默认4M
	 */
//	@Value("${rocketmq.producer.maxMessageSize}")
//	private Integer maxMessageSize;
	/**
	 * 消息发送超时时间，默认3秒
	 */
//	@Value("${rocketmq.producer.sendMsgTimeout}")
//	private Integer sendMsgTimeout;
	/**
	 * 消息发送失败重试次数，默认2次
	 */
//	@Value("${rocketmq.producer.retryTimesWhenSendFailed}")
//	private Integer retryTimesWhenSendFailed;
	

    @Value("${rocketmq.consumer.groupName}")
    private String consumerGroupName;
//    @Value("${rocketmq.consumer.consumeThreadMin}")
//    private int consumeThreadMin;
//    @Value("${rocketmq.consumer.consumeThreadMax}")
//    private int consumeThreadMax;
    @Value("${rocketmq.consumer.topics}")
    private String topics;
//    @Value("${rocketmq.consumer.consumeMessageBatchMaxSize}")
//    private int consumeMessageBatchMaxSize;
}
